home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / mail110 / list.c < prev    next >
C/C++ Source or Header  |  1994-02-25  |  2KB  |  82 lines

  1. //=========================================================
  2. //
  3. //      list.c
  4. //
  5. //      void listqueue(void)
  6. //
  7. //=========================================================
  8.  
  9. // $Id: list.c,v 1.3 1994/02/25 13:34:54 gbj Exp user $
  10.  
  11. /*
  12. $Log: list.c,v $
  13.  * Revision 1.3  1994/02/25  13:34:54  gbj
  14.  * Tidy-up.
  15.  *
  16.  * Revision 1.2  1994/02/08  23:32:02  gbj
  17.  * First public release.
  18.  *
  19.  * Revision 1.1  1994/02/08  03:15:10  gbj
  20.  * Initial revision
  21.  *
  22. */
  23.  
  24. #include "mailer.h"
  25.  
  26. void listqueue(void)
  27. {
  28.         char pattern[128], *p;
  29.         long res;
  30.         int line, done, c;
  31.         struct FILEINFO info, *dta;
  32.         
  33.         strcpy(pattern, mqueuepath);
  34.         strcat(pattern, "\\*.txt");
  35.  
  36.         line=0;
  37.         done=FALSE;
  38.         c='\0';
  39.         
  40.         dta=(struct FILEINFO*)Fgetdta();
  41.         Fsetdta(&info);
  42.         res=Fsfirst(pattern, 0);
  43.         while (res == 0)
  44.         {
  45.                 p=strrchr(info.name, '\\');
  46.                 if (p == NULL)
  47.                         p=info.name;
  48.                 else
  49.                         p++;
  50.                 printf("%s\n", p);
  51.                 line++;
  52.                 if (line > 15)
  53.                 {
  54.                         done=FALSE;
  55.                         while (!done)
  56.                         {
  57.                                 printf("\n(C)ontinue or (Q)uit? ");
  58.                                 c=toupper(getche());
  59.                                 putchar('\r');
  60.                                 putchar('\n');
  61.                                 if (c == 'Q')
  62.                                         done=TRUE;
  63.                                 else if (c == 'C')
  64.                                 {
  65.                                         done=FALSE;
  66.                                         line=0;
  67.                                 }
  68.                         }
  69.                 }
  70.                 if (done)
  71.                         res=-1;
  72.                 else
  73.                         res=Fsnext();
  74.         }               
  75.         Fsetdta(dta);
  76.         printf("Press a key...");
  77.         getch();
  78.         putchar('\n');
  79.  
  80.         return;
  81. }
  82.